package client.control;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Button;
import javafx.event.ActionEvent;
import client.client;

public class AccController {
	@FXML TextField userField;
	@FXML TextField answerField;
	@FXML TextField questionField;
	@FXML TextField passwordField;
	@FXML Button kBtn;
	@FXML Button cancelBtn;

	client c;
	public void setC(client c){
		this.c = c;
	}

	@FXML public void k(ActionEvent event){
		if(questionField.getText().length()==0){
			c.getq(userField.getText());
		}else{
			c.getp(userField.getText(), answerField.getText());
		}
	}

	@FXML public void back(ActionEvent event){
		cancelBtn.getScene().getWindow().hide();
	}

	public void setq(String q){
		questionField.setText(q);
	}

	public void setp(String p){
		passwordField.setText(p);
	}
}